<template>
	<div class="docker">
		<span class="docker_item" :class="{'docker_item--active' : index === currentIndex}" v-for="(item,index) in iconList" :key="index">
			<router-link :to="item.to">
				<div class="iconfont" v-html="item.iconName"></div>
				{{ item.desc }}
			</router-link>
			
		</span>
	</div>
</template>

<script>
	export default{
		name: 'Docker',
		props: ['currentIndex'],
		data() {
			// 存放数据
			const iconList = [
				{iconName:'&#xe600;',desc:'首页',to:{name: 'Home'}},
				{iconName:'&#xe899;',desc:'购物车',to:{name: 'CartList'}},
				{iconName:'&#xe601;',desc:'订单',to:{name: 'OrderList'}},
				{iconName:'&#xe8bb;',desc:'我的',to:{name: 'My_Information'}}
			]
			return { iconList }
		}
	}
</script>

<style lang="scss" scoped>
	.docker {
		display: flex;
		box-sizing: border-box;
		position: absolute;
		padding: 0 .18rem;
		left: 0;
		bottom: 0;
		width: 100%;
		height: .49rem;
		border-top: 1px solid #F1F1F1;
	}
	
	.docker_item {
		flex: 1;
		text-align: center;
		a{
			text-decoration: none;
			color: #333;
		}
		.iconfont {
			margin: .07rem 0 .02rem 0;
			font-size: .2rem;
		}
	}
	
	.docker_item--active {
		a{
			color: #1FA4FC;
		}
	}
</style>